
/*
*Released on 28th June 2008.
*Any violations can be reported at paritosh@wikiocean.net
*What is treated as violations can be found at www.wikiocean.net/ppl1-voilations*
******************************************************************************
* The contents of this file are subject to POOL Public License 1.0 and later.
* POOL Public License is based on Affero GPL v3 and additional conditions.
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the Affero GPL v3 License at http://www.gnu.org/licenses/agpl.html
* You may obtain a copy of the POOL Public License 1.0 or later at www.wikiocean.net/license/ppl.html
* Software distributed under POOL Public License 1.0 is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Initial Developer of the Original Code is Paritosh Pungaliya (C) 2008. All Rights Reserved.
******************************************************************************
* Objective of the additional terms (license)
* 1) Is to extend the software freedom to freedom to work.
* 2) To ensure that knowledge is free from monopoly of agencies.
* 3) To avoid a situation where big corporate or investor can buy out free software groups and companies and then start milking the communities built around it.
* (this trend can be seen how the freedom is curtailed in companies that get Venture Capital funding.)
******************************************************************************
*/

package  query.query;

import java.util.Hashtable;
import java.util.Vector;

import logger.PoolLogger;

import dbmanager.DBManager;
import dbmanager.GetIdName;
/**
 * 
 * @author mahendra
 * <pre>Tablename property is used to give table for the Query like master_table, transaction etc. 
 * By using tablename the condition classes are dynamically bind with their respective classes. 
 * </pre>
 */
public class Tablename implements Queryinterface
{
	String tablename;
	GetIdName gid;
	int Querycount=1;
	String[] buffer;
	String Query;
	String[] Querybuffer;
	String key="no$";
	String value="no$";
	String Reportname;
	Hashtable<Object, Object> QueryMap = new Hashtable<Object, Object>();
	String tid;
	PoolLogger pl;
	
	
	public void queryProcess(){
		
	}
	
	
	
	public Tablename() {
		// logger
		pl = (PoolLogger) PoolLogger.getLogger(this.getClass().getName());
	}
	
	public void getResult()
	{
		
	}
	
	
	public String[] executeQuery(){return null;}
	


	public void initializeData() 
	{
		
	}
	/**
	 * setDbmanager() method set Dbamanager object
	 * @param db is database object  
	 */
	public void initPool() 
	{
		gid = new GetIdName();
	}
	/**
	 * setobject() set tablename
	 * @param object
	 * this method set tablename
	 */
	public void setObject(String object) 
	{
		String value = gid.getItem(object);
		if(value.equals("no$"))
			value = object;
		this.tablename = value;
		buffer[0] = tablename;
	}

	public void setQuerybuffer(String[] Querybuffer) 
	{
		this.Querybuffer = Querybuffer;
	}

	public void setbuffer(String[] Querybuffer) 
	{
		this.buffer = Querybuffer;
		//this.Querybuffer = Querybuffer;
	}
	
	public void settablename(String tablename) 
	{
	}
	/**
	 * getablename return tablename
	 * @return tablename: String
	 */
	public String gettablename() 
	{
		return tablename;
	}
	/**
	 * getbuffer retrun buffer
	 * @return buffer:String array
	 */
	public String[] getbuffer() 
	{
		return buffer;
	}
	/**
	 * getQuerrybuffer() method retrun Querybuffer
	 * @return Querybuffer ;String array
	 */
	public String[] getQuerybuffer()
	{
		return Querybuffer;
	}
	/**
	 * setkey method set key 
	 * @param key 
	 */
	public void setKey(String key) 
	{
		this.key = key; 
		
	}
	public void setValue(String value) 
	{
		this.value = value;
	}
	/**
	 * getkey method return key
	 * @return key :String
	 */
	public String getkey() 
	{
		return key;
	}


	public String getvalue() 
	{
		return value;
	}

	public String getQueryName() 
	{
		return null;
	}

	public void setQueryName(String QueryName) 
	{
		
	}

	
	public Hashtable<Object, Object> getQueryMap() 
	{
		return QueryMap;
	}

	public void setQueryMap(Hashtable<Object, Object> QueryMap) 
	{
		this.QueryMap = QueryMap;
	}
	/**
	 * gettid method return tid
	 * @return tid:String
	 */
	public String gettid() 
	{
		return tid;
	}
	/**
	 * setid method set tid 
	 * @param tid
	 */
	public void settid(String tid) 
	{
		this.tid = tid;
	}

	public void addReport() 
	{
		
	}

	public void updateReport() 
	{
		
	}

	public String getReportname() 
	{
		return Reportname;
	}

	public void setReportName(String Reportname) 
	{
		this.Reportname =Reportname;
	}

	public void settypeofreport(String typeofreport) 
	{
		
	}

	public void setReportmap(Hashtable<Object, Object> ReportMap) {
	
		
	}
	public void setConditionMap(Vector<Object> QueryMap)
	{
		
	}

	public void setreporton(String reporton) {
	
		
	}

	public void setViewObject(String object, char ch) {
	
		
	}

	public void setViewObject(Vector<Object> PropertyMap) 
	{
		this.tablename = PropertyMap.get(0).toString();
		
	}
	public void setQuery(String Query)
	{
		this.Query = Query;
	}
	public String getQuery() 
	{
		return Query;
	}

	
	public int getcount() {
	
		return Querycount;
	}

	
	public void setCount(int count) {
	this.Querycount = count;
		
	}

	
	public void setMaxcount(int count) {
	
		
	}

	
	public void buildQuery() {
	
		
	}

	
	public void setProcess(String process) {
	
		
	}
}
